<?php
class PositionModel extends model
{
	static $_instance = null;

	static function getInstance ()
	{
		if (is_null(self::$_instance)) {
			self::$_instance = new self();
		}
		return self::$_instance;
	}
	
	// 增加机构
	function PositionAdd($p)
	{
		return $this->sql("insert into crm_position (`agency`,`name`,`desc`)values([agency],'[name]','[desc]')",$p)->i();
	}
	
	// 修改机构
	function PositionUpd($p)
	{
		return $this->sql("update crm_position set `name`='[name]',`desc`='[desc]' where `id`='[id]'",$p)->u();
	}
	
	// 删除机构
	function PositionDel($p)
	{
		return $this->sql("delete from crm_position where `id`='[id]'",$p)->u();
	}
}